// 常用方法1 闪屏 toast 提示，2秒后关闭
var toast = {
  t: null,
  show: function (msg, time) {
      var $toast = $('#toast');
      var $mask = $('.mask')
      if (this.t) {
          clearTimeout(this.t);
      }

      if (msg) {
          var $toastContent = $('#toast .toast_content');
          console.log($toastContent)
          $toastContent.html(msg);
      }
      $toast.fadeIn(100);
      $mask.show()
      if (time) {
          toast.t = setTimeout(function () {
              $toast.fadeOut(100);
              $mask.hide()
          }, time);
      } else {
          toast.t = setTimeout(function () {
              $toast.fadeOut(100);
              $mask.hide()
          }, 2000);
      }

  }
}
